<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox-content">
					<form class="form-horizontal m-t" id="signupForm">
						<input id="userId" name="userId" th:value="${user.userId}" type="hidden">
						<input id="tjob" name="tjob" th:value="${user.job}" type="hidden">
						<div class="form-group">
							<label class="col-sm-3 control-label">姓名：</label>
							<div class="col-sm-8">
								<input id="name" name="name" class="form-control" type="text"
									th:value="${user.name}">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">用户名：</label>
							<div class="col-sm-8">
								<input id="username" name="username" class="form-control"
									type="text" th:value="${user.username}" readonly>
							</div>
						</div>
						<div class="form-group">
								<label class="col-sm-3 control-label">专职角色 ：</label>
								<div class="col-sm-8">
									<input id="deptId" name="deptId" class="hidden" th:value="${user.deptId}">
									 <input id="deptName" name="deptName"
										class="form-control" type="text" style="cursor: pointer;"
										onclick="openDept()" readonly="readonly" placeholder="请选择 专职角色" th:value="${user.deptName}">
								</div>
							</div>
						<div class="form-group">	
								<label class="col-sm-3 control-label" for="job">职务：</label>
								<div class="col-sm-8">
									<select data-placeholder="选择职务" name="job" id="job"
										class="form-control chosen-select" tabindex="2"
										style="width: 100%">
										<option value="0">选择职务</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">手机号：</label>
								<div class="col-sm-8">
									<input id="mobile" name="mobile" class="form-control" type="text" th:value="${user.mobile}">
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-3 control-label">接收消息：</label>
								
								<div class="switch onoffswitch col-sm-1">
									<div class="onoffswitch">
										<input id="receiveMsg" name="receiveMsg" type="checkbox" value="1" th:checked=${user.receiveMsg==1} class="onoffswitch-checkbox"> 
										<label class="onoffswitch-label" for="receiveMsg"> 
											<span class="onoffswitch-inner"></span>
											<span class="onoffswitch-switch"></span>
										</label>
									</div>
								</div>
							</div>
						
							
						
						<div class="layui-form  form-group">
							    <label class="col-sm-3  control-label">状态：</label>
							    <div class="layui-input-block">&nbsp;&nbsp;
							      <input type="radio" name="status" value="1" title="正常" th:field="*{user.status}">
							      <input type="radio" name="status" value="0" title="禁用" th:field="*{user.status}">
							    </div>
							 </div>
						<input type="hidden" name="roleIds" id="roleIds"
							th:value="${roleIds}">
						<div class="form-group">
							<label class="col-sm-3 control-label">角色：</label>
							<div class="col-sm-8">
								<label th:each="role:${roles}" class="checkbox-inline">
									<input name="role" type="checkbox" th:value="${role.roleId}"
									th:text="${role.roleName}" th:checked="${role.roleSign}">
								</label>
							</div>
						</div>
						
						<div class="form-group">
							<div class="col-sm-8 col-sm-offset-3">
								<button type="submit" class="btn btn-primary">提交</button>
								<button type="button" class="btn" onclick="javascript:parent.layer.close(parent.layer.getFrameIndex(window.name));">关闭</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript" src="/js/appjs/sys/user/edit.js"></script>
	<script type="text/javascript">
	$(function(){
		$(":checkbox[name=role]").click(function(){
			$(this).attr("checked",true);//设置当前选中checkbox的状态为checked
			//$(this).parent().siblings().find("[name=role]").attr("checked",false); //设置当前选中的checkbox同级(兄弟级)其他checkbox状态为未选中
			});
	})
	
	</script>
</body>
</html>
